package tech.cn.note.html.tool;

import java.util.List;

import freemarker.template.TemplateModelException;

/**
 * 对于空对象的处理
 *
 */
public class NullToEmptyConvert implements DocumentConvert{

    //转换器名称
    private static String CONVERT_NAME = "doNothing";

    @Override
    public String getConvertName() {
        return CONVERT_NAME;
    }

    @Override
    public Object exec(List params) throws TemplateModelException {
        if(params == null || params.size()<=0){
            return "";
        }
        if(params.get(0) == null){
            return "";
        }
        return params.get(0);
    }
}
